home *** CD-ROM | disk | FTP | other *** search
- package symantec.itools.awt;
-
- import java.awt.Canvas;
- import java.awt.Component;
- import java.awt.Event;
- import java.awt.Graphics;
- import java.awt.Image;
- import java.awt.Rectangle;
- import java.awt.image.ImageObserver;
- import symantec.beans.Beans;
-
- public class InvisibleButton extends Canvas {
- protected boolean pressed = false;
- // $FF: renamed from: pc java.awt.Component
- private Component field_0;
- private Rectangle pbt;
- private Rectangle pbc;
- // $FF: renamed from: pi java.awt.Image
- private Image field_1;
-
- protected void paintComponent(Component var1, Graphics var2) {
- Rectangle var3 = var1.bounds();
- Rectangle var4 = ((Component)this).bounds();
- if (var3.intersects(var4)) {
- boolean var5 = false;
- if (this.field_0 == null || this.field_0 != var1) {
- this.field_0 = var1;
- var5 = true;
- }
-
- if (this.pbt == null || !this.pbt.equals(var4)) {
- this.pbt = var4;
- var5 = true;
- }
-
- if (this.pbc == null || !this.pbc.equals(var3)) {
- this.pbc = var3;
- var5 = true;
- }
-
- if (var5 || this.field_1 == null) {
- if (this.field_1 != null) {
- this.field_1.flush();
- }
-
- this.field_1 = ((Component)this).createImage(var3.width, var3.height);
- if (Beans.isDesignTime()) {
- System.gc();
- }
- }
-
- Graphics var6 = this.field_1.getGraphics();
- var1.paint(var6);
- var2.drawImage(this.field_1, var3.x - var4.x, var3.y - var4.y, (ImageObserver)null);
- var6.dispose();
- }
-
- }
-
- public void paint(Graphics var1) {
- Component[] var2 = ((Component)this).getParent().getComponents();
-
- for(int var3 = 0; var3 < var2.length; ++var3) {
- Component var4 = var2[var3];
- if (!(var4 instanceof InvisibleButton)) {
- this.paintComponent(var4, var1);
- }
- }
-
- }
-
- public boolean mouseDown(Event var1, int var2, int var3) {
- this.pressed = true;
- return true;
- }
-
- public boolean mouseUp(Event var1, int var2, int var3) {
- if (this.pressed) {
- this.pressed = false;
- ((Component)this).postEvent(new Event(this, 1001, (Object)null));
- }
-
- return true;
- }
- }
-